<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
</head>

<body>
    <div id="app">
        <cpn></cpn>
        <cpn ref="aaa"></cpn>
        <cpn></cpn>
        <button @click="fn" ref="btn">click</button>
    </div>
    <template id="cpn">
        <div>
            <h3>子组件</h3>
        </div>
    </template>
    <script>
        const cpn = {
            template: "#cpn",

        }
        const app = new Vue({
            el: "#app",
            data() {
                return {

                }
            },
            methods: {
                fn() {
                    console.log(this.$refs.btn,typeof this.$refs.btn)//<button>click</button> object
                    console.log(this.$refs.aaa,typeof this.$refs.aaa) //VueComponent  object
                }
            },
            components: {
                cpn
            }

        })
    </script>
</body>

</html>